<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2016 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------

use think\Route;

// index

// user路由
Route::get('/', 'index/index/index');
Route::get('/admin/index', 'admin/Main/index');

//Route::get('admin/login','admin/Index/logindo');
//Route::get('admin','admin/Main/index');
Route::get('admin/user','admin/User/userlist');
Route::get('admin/usercreate','admin/User/usercreate');
Route::post('admin/save','admin/User/save');
Route::get('admin/rolelist/:id','admin/User/rolelist');
Route::post('admin/dorolelist','admin/User/dorolelist');
Route::get('admin/userdel/:id','admin/User/userdel');
Route::get('admin/useredit/:id','admin/User/useredit');
Route::post('admin/douseredit/;id:','admin/User/douseredit');
//Route::delete('admin/userdel','admin/User/userdel');

// role路由
Route::get('admin/addrole','admin/Role/addrole');
Route::post('admin/doaddrole','admin/Role/doaddrole');
Route::get('admin/roleindex','admin/Role/index');
Route::get('admin/nodelist','admin/Role/nodelist');
Route::post('admin/donodelist','admin/Role/donodelist');
Route::get('admin/roleedit','admin/Role/roleedit');
Route::post('admin/doroleedit','admin/Role/doroleedit');
Route::get('admin/roledel/:id','admin/Role/roledel');
//node 路由

Route::get('admin/nodeindex','admin/Node/index');
Route::get('admin/addnode','admin/Node/addnode');
Route::post('admin/doaddnode','admin/Node/doaddnode');
Route::get('admin/nodeedit/:id','admin/Node/nodeedit');
Route::post('admin/donodeedit','admin/Node/donodeedit');
Route::get('admin/nodedel','admin/Node/nodedel');
// 定义资源路由
//Route::resource('user','admin/User');


//login
Route::get('admin/login','admin/Login/index');
Route::post('admin/dologin','admin/Login/dologin');
return [
    '__pattern__' => [
        'name' => '\w+',
    ],
    '[hello]'     => [
        ':id'   => ['index/hello', ['method' => 'get'], ['id' => '\d+']],
        ':name' => ['index/hello', ['method' => 'post']],
    ],

];

